package xq.gwt.mvc.controller;

import xq.gwt.mvc.model.BooleanPropertyModel;
import xq.gwt.mvc.view.BooleanPropertyView;

public class BooleanPropertyController extends AbstractPropertyController {

	protected BooleanPropertyModel booleanModel;
	protected BooleanPropertyView booleanView;
	
	public BooleanPropertyController(BooleanPropertyView booleanView){
		super(booleanView);
		this.booleanView = booleanView;
	}
	
	
	public void setPropertyModel(BooleanPropertyModel booleanModel) {
		this.booleanModel = booleanModel;
		super.setPropertyModel(booleanModel);

	}
	
	@Override
	public void updateModel() {
		if (booleanModel != null)
			booleanModel.setValue(booleanView.getBoolean());

	}

	@Override
	public void updateView() {
		if (booleanView != null)
			booleanView.setBoolean(booleanModel.getValue());
	}

}
